USE QuanLyKho
GO
ALTER PROC insertNhapKho
 @ngayNhap datetime,
 @ncId int,
 @nkId int OUTPUT
AS
 insert into NhapKho(ngayNhap,ncId) values(@ngayNhap,@nkId) Set @nkId=SCOPE_IDENTITY()


Delete from NhapKho
DECLARE @id int;
exec  insertNhapKho '02/02/2011',1,@id OUT
select @id